package com.jdbcpool.bag1;


import java.sql.Connection;
public class TestConnectionPool{ 
   public static void main(String[] args) { 
    SimpleConnetionPool.setUrl("com.microsoft.jdbc.sqlserver.SQLServerDriver"); 
       SimpleConnetionPool.setUser("sa"); 
       SimpleConnetionPool.setPassword("sql123"); 
       Connection con = SimpleConnetionPool.getConnection(); 
       Connection con1 = SimpleConnetionPool.getConnection(); 
       Connection con2 = SimpleConnetionPool.getConnection(); 
       System.out.println("I Say:all connection succeed!");

       try { 
        con.close(); 
        con=null;
        System.out.println("I Say:close1 succeed!");
    } catch (Exception e) {} 
    
       try { 
           con1.close();
           System.out.println("I Say:close2 succeed!");
       } catch (Exception e) {}

       try { 
           con2.close(); 
           System.out.println("I Say:close3 succeed!");
       } catch (Exception e) {}

       con = SimpleConnetionPool.getConnection(); 
       con1 = SimpleConnetionPool.getConnection(); 
       try { 
           con1.close(); 
           System.out.println("I Say:close4 succeed!");
       } catch (Exception e) {}

       con2 = SimpleConnetionPool.getConnection(); 
           SimpleConnetionPool.printDebugMsg(); 
    } 
}
